package com.mumuso.mumusoitem.controller;

import com.mumuso.mumusoitem.pojo.dQiyeSendMsg;
import com.mumuso.mumusoitem.service.dQiyeSendMsgService;
import com.mumuso.mumusoitem.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/send")
public class dQiyeSendMsgController {

    @Autowired
    private dQiyeSendMsgService dQiyeSendMsgService;


    /**
     * 发送消息
     * @param dQiyeSendMsg
     * @return
     */
    @PostMapping("/sendMsg")
    public AjaxResult sendMessageInfo(@RequestBody dQiyeSendMsg dQiyeSendMsg) {
        int effectLine = dQiyeSendMsgService.sendMessage(dQiyeSendMsg);
        if (effectLine > 0) {
            return AjaxResult.success("已经将消息发送给制单人!!!!");
        } else {
            return AjaxResult.error("消息提醒未发送成功!!!!!");
        }
    }
}
